/**
 * @param {string} A
 * @param {string} B
 * @return {string[]}
 */
var uncommonFromSentences = function (A, B) {
  let arr = A.split(' ').concat(B.split(' '))
  let min = 1
  let result = []
  let keyMap = {}
  for (let i = 0; i < arr.length; i++) {
    if (!keyMap[arr[i]]) {
      keyMap[arr[i]] = 0
    }
    keyMap[arr[i]]++
  }
  for (let i in keyMap) {
    if (keyMap[i] <= min) {
      result.push(i)
    }
  }
  return result
};
let strA = 'this apple is sweet'
let strB = 'this apple is sour'
console.log(uncommonFromSentences(strA, strB))